package com.cheyun.netsalev3.view

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProviders
import com.cheyun.netsalev3.R
import com.cheyun.netsalev3.databinding.ActivityReceptionBinding
import com.cheyun.netsalev3.utils.BaseActivity
import com.cheyun.netsalev3.utils.InjectorUtils
import com.cheyun.netsalev3.viewmodel.ReceptionActivityViewModel

class ReceptionActivity : BaseActivity<ActivityReceptionBinding>() {
    override fun initContentView(): Int {
        return R.layout.activity_reception
    }

    var storeitemsname:String = ""
    var tracktagname:String = ""
    var seriesname:String = ""

    override fun initViewModel(): ViewModel? {
        var id = intent.getStringExtra("id")?:""
        storeitemsname = intent.getStringExtra("storeitemsname")?:""
        tracktagname = intent.getStringExtra("tracktagname")?:""
        seriesname = intent.getStringExtra("seriesname")?:""
        var factory = InjectorUtils.getReceptionActivityViewModelFactory(id)
        return ViewModelProviders.of(this,factory).get(ReceptionActivityViewModel::class.java)
    }

    override fun initView() {
//        binding.cancelBut.setOnClickListener {
//            finish()
//        }
        binding.txtStoreitemsname.text = storeitemsname
        binding.txtTracktagname.text = tracktagname
        binding.txtSeriesname.text = seriesname

    }

    override fun initData() {

    }
}
